<template>
	<view class="usercenter">
		<view class="usercenter-header">
			<u-avatar size="60" :text="userName" bg-color="#fff" color="#e2231a"></u-avatar>
			<u--text :text="userPhone" color="#fff" margin="0 0 0 25rpx" size="20"></u--text>
		</view>
		<view class="dy-card-row order-list">
			<view class="order-item" v-for="item in tabList" :key="item.label" @click="toOrderPage(item)">
				<image style="width: 90rpx; height: 90rpx;" :src="item.icon" mode="widthFix"></image>
				<u--text :text="item.label" size="17" color="#2c2c2c" margin="10px 0 0 0 "></u--text>
			</view>
		</view>

		<view class="usercenter-footer" @click="toCertification">
			<u--text text="服务资质" type="primary"></u--text>
		</view>
		<ImButton />
	</view>
</template>

<script>
	import ImButton from '@/components/im-button/im-button.vue'
	import {
		orderList
	} from "@/common/orderConfig.js"
	import {
		paramsToObj
	} from '@/util/miniLodash.js'
	export default {
		data() {
			return {
				tabList: orderList
			}
		},
		components: {
			ImButton
		},
		computed: {
			userName() {
				return '靓'
			},
			userPhone() {
				return '靓鲸洗用户'
			}
		},
		methods: {
			toOrderPage(item) {
				const status = item.value
				uni.navigateTo({
					url: `/pages/order/list/list?status=${status}`,
				})
			},
			toCertification() {
				uni.navigateTo({
					url: `/pages/usercenter/certification`,
				})
			}
		}
	}
</script>

<style lang="scss">
	.usercenter {
		&-header {
			background-color: #e2231a;
			width: 100vw;
			height: 260rpx;
			display: flex;
			align-items: center;
			padding: 30rpx 30rpx 90rpx;
			box-sizing: border-box;
		}

		&-footer {
			position: fixed;
			bottom: 50rpx;
			left: 50%;
			transform: translateX(-50%);
		}
	}

	.order-list {
		background-color: #fff;
		width: 700rpx;
		border-radius: 20rpx;
		padding: 40rpx 25rpx;
		margin: 0 auto;
		transform: translateY(-60rpx);
	}

	.order-item {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		align-items: center;
	}
</style>